﻿namespace GSC.WebControls
{
    using System;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    /// <summary>
    /// 扩展异步ID列表集合事件。
    /// </summary>
    /// <remarks>扩展异步ID列表集合事件。</remarks>
    public class CreatedAsyncControlIDsEventArgs : EventArgs
    {
        private List<string> _asyncControlIDs;
        /// <summary>
        /// 初始化扩展异步ID列表集合事件。
        /// </summary>
        /// <remarks>初始化扩展异步ID列表集合事件。</remarks>
        /// <param name="asyncIDs">设置扩展ID列表集合。</param>
        public CreatedAsyncControlIDsEventArgs(List<string> asyncIDs)
        {
            this._asyncControlIDs = asyncIDs;
        }
        /// <summary>
        /// 获取扩展ID列表集合。
        /// </summary>
        /// <remarks>获取扩展ID列表集合。</remarks>
        /// <value>System.Collections.Generic.List&lt;string&gt;</value>
        public List<string> AsyncControlIDs
        {
            get
            {
                return _asyncControlIDs;
            }
        }
        /// <summary>
        /// 添加异步控件ID。
        /// </summary>
        /// <remarks>添加异步控件ID。</remarks>
        /// <param name="clientID">要添加异步操作的控件ID。</param>
        public void AddAsyncControlID(string clientID)
        {
            this._asyncControlIDs.Add(clientID);
        }
        /// <summary>
        /// 添加异步控件。
        /// </summary>
        /// <remarks>添加异步控件。</remarks>
        /// <param name="control">要添加异步操作的控件对象。</param>
        public void AddAsyncControl(Control control)
        {
            this._asyncControlIDs.Add(control.ClientID);
        }
        /// <summary>
        /// 删除异步控件ID。
        /// </summary>
        /// <remarks>删除异步控件ID。</remarks>
        /// <param name="clientID">要删除异步操作的控件ID。</param>
        public void RemoveAsyncControlID(string clientID)
        {
            this._asyncControlIDs.Remove(clientID);
        }
    }
}